
import 'package:flutter/material.dart';

class ToastWidget extends StatelessWidget {
  const ToastWidget({
    Key? key,
    required this.msg,
    this.alignment = Alignment.bottomCenter,
  }) : super(key: key);

  ///信息
  final String msg;

  ///toast显示位置
  final AlignmentGeometry alignment;

  @override
  Widget build(BuildContext context) {
    return Align(
      alignment: alignment,
      child: Container(
        margin: const EdgeInsets.symmetric(horizontal: 30, vertical: 50),
        padding: const EdgeInsets.symmetric(horizontal: 25, vertical: 10),
        decoration: BoxDecoration(
          color: Colors.black87,
          borderRadius: BorderRadius.circular(20),
        ),
        child: Text(
          msg,
          style: const TextStyle(color: Colors.white),
        ),
      ),
    );
  }
}